package com.pogodin.seleniumtesting;

import java.io.File;
import java.io.IOException;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;

import com.thoughtworks.selenium.DefaultSelenium;
import com.thoughtworks.selenium.Selenium;

public class SeleniumMainTesting {

	/**
	 * try to do some with selenium
	 */
	public static void main(String[] args) {

		String path = "C:/dev/download/chromedriver.exe";
		
		ChromeDriverService service = new ChromeDriverService.Builder()
			.usingChromeDriverExecutable(new File(path))
			.usingAnyFreePort()
			.build();
		try {
			service.start();
		} catch (IOException e) {
			e.printStackTrace();
		}
		WebDriver driver = new RemoteWebDriver(service.getUrl(),DesiredCapabilities.chrome());
		
		driver.get("http://www.google.com");
		
		driver.quit();
		service.stop();
	}

}
